home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 24
/
AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
MT-RechnungIII
/
Rexx
/
WWPaketkarte.outrexx
< prev
next >
Wrap
Text File
|
1998-08-23
|
3KB
|
148 lines
/*
** Druck-, Vorschau, Sichern der Paketkarte zur Rechnung mit Hilfe von WordWorth
** $VER: WWPaketkarte.outrexx V1.00 (19.08.98)
*/
PARSE ARG ARexxPort;
ADDRESS VALUE ARexxPort;
OPTIONS RESULTS;
WWVorlage = "WWDokumente/Paketkarte.ww";
WWDokument = "t:Paketkarte.ww";
WWPort = "WORDWORTH."
LF = '0a'x; /* Zeilenvorschub */
Gefunden = 0;
DO i = 1 TO 20 WHILE(Gefunden = 0)
IF show(ports, (WWPort || i)) THEN
DO;
Gefunden = 1;
WWPort = WWPort || i;
END;
END;
IF Gefunden = 0 THEN
DO;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "WordWorth ist nicht aktiv, bitte starten sie dieses" || LF || "und versuchen Sie es erneut";
ES_GADGETFORMAT = "Abbrechen";
EASY_REQUEST;
EXIT;
END;
/* Original WW-Dokument nach t: kopieren, um ein versehentliches überschreiben */
/* dieser Vorlage zu verhindern */
GET_REXXPATH;
WWVorlage = MTR_RESULT || WWVorlage;
ADDRESS COMMAND "copy" WWVorlage WWDokument;
/* Oberfläche sperren */
LOCKGUI;
/* Art ermitteln: 0 = Drucken, 1 = Vorschau, 2 = Speichern */
PRINTSTATE;
Druckart = MTR_RESULT;
Ende_Kennzeichen = 'N';
/* Suchen der zu druckenden Daten */
GET_PREFS;
PRINTFIND;
/* Neues Dokument öffnen */
ADDRESS VALUE WWPort;
NEW;
WWPort = RESULT;
ADDRESS VALUE ARexxPort;
DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
CALL DatenAufbereiten;
SELECT;
WHEN Druckart = 0 THEN /* Drucken */
DO;
ADDRESS VALUE WWPort;
PRINT;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
WHEN Druckart = 1 THEN /* Vorschau */
ADDRESS VALUE ARexxPort;
WHEN Druckart = 2 THEN /* Sichern */
DO;
ADDRESS VALUE WWPort;
SAVEAS;
ADDRESS VALUE ARexxPort;
MTSCREENTOFRONT;
END;
OTHERWISE
DO;
ADDRESS VALUE ARexxPort;
ES_TITLE = "Warnung";
ES_TEXTFORMAT = "Druckart wird nicht unterstützt!";
ES_GADGETFORMAT = "Ok";
EASY_REQUEST;
Ende_Kennzeichen = 'J';
END;
END;
PRINTFIND;
END;
/* WordWorth-Datei aus t: wieder entfernen */
ADDRESS COMMAND "delete" WWDokument;
/* Oberfläche wieder entsperren */
ADDRESS VALUE ARexxPort;
FREEGUI;
EXIT;
DatenAufbereiten:
NAME_OF_SALUTATION OB.INVOICEE.CUSTOMER.ADDRESS.SALUTATION;
ZW_Anrede = MTR_RESULT;
ADDRESS VALUE WWPort;
OPEN FILENAME WWDokument FORCE;
POSITION SOF;
IF OB.OFFICE.ADDRESS.COMPANY1 > "" THEN
ZW_Adresse = OB.OFFICE.ADDRESS.COMPANY1;
ELSE
ZW_Adresse = OB.OFFICE.ADDRESS.PRENAME OB.OFFICE.ADDRESS.SURNAME;
FINDCHANGE FIND "<SENDER.SUR_PRENAME>" CHANGE ZW_Adresse;
POSITION SOF;
FINDCHANGE FIND "<SENDER.STREET>" CHANGE OB.OFFICE.ADDRESS.STREET;
POSITION SOF;
FINDCHANGE FIND "<SENDER.ZIP>" CHANGE OB.OFFICE.ADDRESS.ZIP;
POSITION SOF;
FINDCHANGE FIND "<SENDER.CITY>" CHANGE OB.OFFICE.ADDRESS.CITY;
POSITION SOF;
FINDCHANGE FIND "<RECEIVER.SALUTATION>" CHANGE ZW_Anrede;
POSITION SOF;
IF OB.INVOICEE.CUSTOMER.ADDRESS.COMPANY1 > "" THEN
ZW_Adresse = LEFT( OB.INVOICEE.CUSTOMER.ADDRESS.COMPANY1, 24 );
ELSE
ZW_Adresse = LEFT( (OB.INVOICEE.CUSTOMER.ADDRESS.PRENAME OB.INVOICEE.CUSTOMER.ADDRESS.SURNAME), 24 );
FINDCHANGE FIND "<RECEIVER.SUR_PRENAME>" CHANGE ZW_Adresse;
POSITION SOF;
FINDCHANGE FIND "<RECEIVER.STREET>" CHANGE OB.INVOICEE.CUSTOMER.ADDRESS.STREET;
POSITION SOF;
FINDCHANGE FIND "<R.ZIP>" CHANGE OB.INVOICEE.CUSTOMER.ADDRESS.ZIP;
POSITION SOF;
FINDCHANGE FIND "<RECEIVER.CITY>" CHANGE OB.INVOICEE.CUSTOMER.ADDRESS.CITY;
RETURN;